<template>
  <div class="brand">
    <ul>
      <li
        v-for="item in brandList"
        :key="item.id"
        @click="toBrandDetail(item.id)"
      >
        <img
          :src="item.list_pic_url"
          width="100%"
          alt=""
        />
        <h4>{{ item.name }}</h4>
        <p>{{item.floor_price | RMBformat}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["brandList"],
  methods: {
    toBrandDetail(id) {
      this.$router.push("/brandDetail?id=" + id);
    },
  },
};
</script>

<style lang="less" scoped>
.brand ul {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 2rem;
  li {
    width: 49%;
    position: relative;
    h4 {
      position: absolute;
      top: 10px;
      left: 10px;
    }
    p {
      position: absolute;
      top: 40px;
      left: 10px;
      color: #8b0000;
    }
  }
  img {
    opacity: 0.5;
  }
}
</style>